package com.alks.function.controller.stockdept.pcfactorystockquery;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.entity.data.entity.PcStitchSupplementProd;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.stockdept.pcfactorystockwork.StcSupRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.StcSupUpRequest;
import com.alks.function.service.stockdept.pcfactorystockquery.IStcSupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@ApiRestController("/pcFactorStockQuery")
@Api(value = "仓储部查询",tags = "仓储部-仓储工厂作业-针车补单缴库")
@RequiredArgsConstructor
@RoleCheck(prgIds = {"160119"})
public class StcSupController {
    private final IStcSupService service;

    @PutMapping("/getStcSupQuery")
    @ApiOperation(value = "针车补单缴库-针车补制明细-可条件分页查询", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo getStcSupQuery(@RequestBody StcSupRequest request) {
        return service.getStcSupQuery(request);
    }

    @GetMapping("/stitchSuppBack")
    @ApiOperation(value = "针车补单缴库-针车补制明细-补单回显", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo stitchSuppBack(@RequestParam(required = false) String slipNo) {
        return service.stitchSuppBack(slipNo);
    }

    @PostMapping("/getStcSupLotQuery")
    @ApiOperation(value = "针车补单缴库-指令补制明细-条件查询", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo getStcSupLotQuery(@RequestParam@ApiParam("指令") String lotNo) {
        return service.getStcSupLotQuery(lotNo);
    }

    @PutMapping("/stcSupAdd")
    @ApiOperation(value = "针车补单缴库-针车补制新增-新增", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo getStcSupAdd(@RequestBody PcStitchSupplementProd request) {
        return service.stcSupAdd(request);
    }

    @PutMapping("/stcSupUpdate")
    @ApiOperation(value = "针车补单缴库-针车补制修改-更新", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo stcSupUpdate(@RequestBody PcStitchSupplementProd request) {
        return service.stcSupUpdate(request);
    }

    @PutMapping("/stcSupDelete")
    @ApiOperation(value = "针车补单缴库-针车补制删除-删除", tags = "仓储部-仓储工厂作业-针车补单缴库")
    public ResponseInfo stcSupDelete(@RequestParam Integer id) {
        return service.stcSupDelete(id);
    }

}
